#ifndef DEBUG_H
#define DEBUG_H

#ifdef CO_DEBUG
void co_debug(char *kind, char *fmt, ...);
#define debug(kind, fmt...) if (debug_level & DBG_##kind) { co_debug(#kind, fmt); }
#else
#define debug(kind, fmt...)
#endif

/* Would be nice to have tons of these; should go to arbitrary bitsets */
#define DBG_LEX         0x0001
#define DBG_YACC		0x0002
#define DBG_COMPILE		0x0004
#define DBG_AST         0x0008
#define DBG_EVAL        0x0010
#define DBG_STACK       0x0011

extern int debug_level;

#endif
